package com.hmall.item.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.domain.pojo.Item;
import org.apache.ibatis.annotations.Select;

/**
 * 商品数据层接口
 *
 * @author xiaojiangshi
 */
public interface ItemMapper extends BaseMapper<Item> {

    /**
     * 规定行锁
     * @param id 商品id
     * @return item数据
     */
    @Select("select * from tb_item where id = #{id} for update;")
    Item selectForUpdate(Long id);
}
